<template>
    <div class="titlelist" :title_id="title_id" :title="title" :id="title_id">
        <p style="display: flex;justify-content: space-between;align-items: center;background: white;padding: .3rem 0;overflow: hidden" @click="goRanking(title_id)" >
            <span class="newBack" style="margin-left: .24rem;font-size: .32rem; font-weight: 700;text-align: center; color: #9948c3; display: flex;justify-content: center; align-items: center; width: 2.4rem; height: .28rem; background: url(https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/separate_style.png) no-repeat 50%;
            background-size: cover;">{{title}}</span>
            <span style="margin-right: .24rem;font-size: .3rem;color: #646464;display: flex;align-items: center;">查看更多<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/more@2x.png" style="margin-left: .1rem;width: .14rem;height: .26rem;display: inline-block;"></span>
        </p>
        <div id="guess" style="background: white;margin-bottom: .2rem;">
            <div id="scroller">
                <ul class="spot-inner" :style="newWidth">
                    <li class="spot-inner-con" :key="y" v-for="(x,y) in hotArrays" :id="x.id" :type="x.id_type"  @click="goNewDetail($event)">
                        <div class="swiper-slides">
                            <ul class="goods1">
                                <li class="photo"><img :src="x.pro_img" style="border-radius:.1rem;"></li>
                                <li class="test" style="height: .63rem;-webkit-box-orient: vertical;">{{x.pro_title}}</li>
                                <li class="money" style="margin-top: .16rem;"><span class="newBtns">砍到{{x.pro_price}}元</span></li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script>
  //import IScroll from 'iscroll/build/iscroll-probe.js';
  export default {
    data(){
      return {
        newWidth:''
      }
    },
    props:{
      hotArrays:Array,
      title:'',
      title_id:''
    },
    updated(){
      //this.createIScroll()
    },
    methods: {
      // createIScroll() {
      //     this.myScroll = new IScroll('#scroller', {  probeType: 3, mouseWheel: true, scrollX: true, scrollY: false,preventDefault:false});
      // },
      goRanking(id){
        this.$router.push('/lookMore/'+id)
      },
      goNewDetail($event){
        var proId=$event.currentTarget.getAttribute('id'),
          type=$event.currentTarget.getAttribute('type');
        this.$router.push('/newDetail/'+proId+''+'/'+type);
      }
    }
  }
</script>

<style>
</style>
